package com.shigu.mo.services;

import com.opentae.data.mall.examples.ManagerUserRoleExample;
import com.opentae.data.mall.interfaces.ManagerUserRoleMapper;
import com.opentae.data.mall.interfaces.MoShareProfitMapper;
import com.shigu.admin.manager.vo.AgentVO;
import com.shigu.agent.enums.UserRoleType;
import com.shigu.main4.common.tools.ShiguPager;
import com.shigu.mo.vo.OperateCountVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 运营商服务
 */
@Service
public class OperationService {

    @Autowired
    private MoShareProfitMapper moShareProfitMapper;

    private ManagerUserRoleMapper managerUserRoleMapper;


    /**
     * 运营商首页使用的统计数据
     * @param from
     * @param to
     *
    model.addAttribute("todayAllTradeMoney","100.00");//今日总交易额
    model.addAttribute("todayProfits","0.50");//今日分润
    model.addAttribute("todayAllTradeNum","3");//今日交易笔数
    model.addAttribute("todaySuccessTradeNum","2");//今日交易成功笔数
    model.addAttribute("todayAllUserNum","30");//总用户数
    model.addAttribute("todayNewUserNum","2");//今日新增用户总数
    model.addAttribute("todayDailiUserNum","9");//今日代理总数
    model.addAttribute("todayDailiNewUserNum","2");//今日新增代理数
     * @return
     */
    public OperateCountVO countForIndex(Date from,Date to){
        //交易额+分润

        return null;
    }

    public ShiguPager<AgentVO> agentsList(Integer page){
        ShiguPager<AgentVO> pager=new ShiguPager<>();
        pager.setNumber(page);
        ManagerUserRoleExample roleExample=new ManagerUserRoleExample();
        ManagerUserRoleExample.Criteria cri=roleExample.createCriteria().andRoleIdEqualTo(UserRoleType.AGENT.getRoleId());
        return null;
    }
}
